# Contributor: Michael Jeanson <mjeanson@efficios.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=lttng-tools
pkgver=2.13.14
pkgrel=0
pkgdesc="LTTng 2.0 control and utility programs"
url="https://lttng.org"
arch="all"
license="GPL-2.0-only AND LGPL-2.1-only"
depends="babeltrace"
depends_dev="
	kmod-dev
	libxml2-dev
	lttng-ust-dev
	popt-dev
	userspace-rcu-dev
	util-linux-dev
	"
makedepends="$depends_dev autoconf automake bash coreutils grep libtool"
checkdepends="util-linux"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://lttng.org/files/lttng-tools/lttng-tools-$pkgver.tar.bz2
	test.patch
	remove-usage-of-off64_t.patch
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var
	make
}

check() {
	# only run unit tests. all tests takes too much time
	make -j1 -C tests/unit check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
61bdebb539cfb4eb61c9806e98742f39dc032d849b03d90cdb98d1891bd5bfbd0cb1f54bbc7bf79a11505ce7fee558497312d650bb41f11f739884e7cb8a750f  lttng-tools-2.13.14.tar.bz2
1f4d0591b55955a698fe9767c8ce2676a25abdd6e2fb2d7addea8e23cf332c32631ca3d86bb2d1b0239cad972eb649418284ff12f36993373a15a9578dc52401  test.patch
79cfe2235f6758bbd770a83645d9eab92f9c7fc244147c64e4e965d28ff5bbeef534dc65dad079dcca1c4e5260d004b5a370ff92ad457b45337be3f22d1cdb77  remove-usage-of-off64_t.patch
"
